# Contributor: Holger Jaekel <holger.jaekel@gmx.de>
# Maintainer: Holger Jaekel <holger.jaekel@gmx.de>
pkgname=superlu
pkgver=7.0.0
pkgrel=0
pkgdesc="Sparse LU factorization library"
url="https://portal.nersc.gov/project/sparse/superlu/"
arch="all"
license="BSD-3-Clause"
makedepends="
	cmake
	gfortran
	openblas-dev
	samurai
	"
subpackages="
	$pkgname-dev
	"
source="
	superlu-$pkgver.tar.gz::https://github.com/xiaoyeli/superlu/archive/refs/tags/v$pkgver.tar.gz
	"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX:PATH=/usr \
		-DCMAKE_INSTALL_LIBDIR="lib" \
		-DCMAKE_INSTALL_INCLUDEDIR="include/superlu" \
		-Denable_internal_blaslib:BOOL=OFF \
		-DBUILD_SHARED_LIBS=ON
	cmake --build build
}

check() {
	cd build
	ctest --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
d2b35ccfd4bee6f5967a1a65edc07d32a7d842aa3f623494de78cf69dc5f4819d82f675d6b2aec035fcbca0a8a3966ab76fa105e6162e8242eb6a56870e41cba  superlu-7.0.0.tar.gz
"
